﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Demo
{
    public class Student
    {
        #region 私有成员变量
        private string stuNo;//类中私有成员变量
        private string stuName;
        private float score;
        #endregion

        #region             公开成员属性

        public string StuNo
        {
            get { return stuNo; }
            set { stuNo = value; }
        }
        public string StuName
        {
            get { return stuName; }
            set { stuName = value; }
        }
        public float Score
        {
            get { return score; }
            set { score = value; }
        }
        #endregion

        #region  构造函数
        public Student(string stuNo, string stuName)
        {
            this.stuNo = stuNo;
            this.stuName = stuName;
            this.score = 100;
        }
        public Student()
        {
            this.stuNo = "2015001";
            this.stuName = "周末";
            this.score = 100;
        }
        #endregion

        #region 成员函数（方法）
        public string CheckGrade()
        {
           int grade=(int) this.score / 10;
           string result = "";
           switch (grade)
           {
               case 10:
               case 9:
                   result = "优秀";
                   break;
               default:
                   result = "不及格";
                   break;
           }
           return result;
        }
        #endregion

    }
}